<meta charset="utf-8">
<script>
function pull_icon() {
	var nav_li = document.getElementById("nav_li");
	var tri_img = nav_li.children[3];
	var len_img = tri_img.length;
	var nav2 = nav_li.children[4];

	for(var i = 0; i < len_img; i++) {
		(function (num) {
			tri_img[num].onclick = function () {
				if(this.nextElementSibling == "nav2") {
					if(nav2.style.display == "block" ) {
						tri_img[num].className = "tir_up";
						tri_img[num].innerHTML = "<img src=\"images/tri-up.png\" alt=\"图片\" width=\"15\" height=\"10\">";
						nav2.style.display = "none";
					} else {
						tri_img[num].className = "tir_down";
						tri_img[num].innerHTML = "<img src=\"images/tri-down.png\" alt=\"图片\" width=\"15\" height=\"10\">";
						nav2.style.display = "block";
					}
				} else {
					if(tri_img.style.display == "block" ) {
					tri_img[num].className = "tir_up";
					tri_img[num].innerHTML = "<img src=\"images/tri-up.png\" alt=\"图片\" width=\"15\" height=\"10\">";
					nav2.style.display = "none";
				} else {
					tri_img[num].className = "tir_down";
					tri_img[num].innerHTML = "<img src=\"images/tri-down.png\" alt=\"图片\" width=\"15\" height=\"10\">";
					nav2.style.display = "block";
				}
				}
				
			}
		}(i))
	}
}
</script>

<?php
	echo "<script>pull_icon();</script>";
?>